function [ r ] = log_safe( v )

r = log(v);

for k=1:1:size(r, 2)
    if (r(k) == -inf)
        r(k) = -1e-100;
    end
end

end

